import request from '../utils/request'

export const getTodos = () => {
  return request({
    method: 'get',
    url: '/todos'
  })
}

export const addTodos = (data) => {
  return request({
    method: 'post',
    url: '/todos',
    data
  })
}

export const editTodos = (completed, id) => {
  return request({
    method: 'patch',
    url: '/todos/' + id,
    data: {
      completed
    }
  })
}

export const deleteTodos = (id) => {
  return request({
    method: 'delete',
    url: '/todos/' + id
  })
}
